<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<title>水平垂直居中</title>
	<style type="text/css">
		/*#element{
			position: absolute;
			top: 0;left: 0;bottom: 0;right: 0;
			width: 400px;
			height: 300px;
			border: 1px solid black;
			margin: auto;
		}*/
		#element{
			display:table-cell;
			vertical-align: middle;
			text-align: center; 
			width: 400px;
			height: 300px;
			border: 1px solid black;

		}

	</style>
</head>
<body>
	<div id="element">vicky</div>

</body>
</html>